<template>
    <div class='Repair_information'>
        <div class='step'>
            <ul>
                <li><a href="javascript:;">1.登录信息</a></li>
                <li>2.维修厂信息</li>
                <li class='col-919'>3.提现信息</li>
            </ul>
        </div>
        <div class='form'>
            <div>
                <input type='text' v-model='form.company' placeholder='请输入公司名称'>
            </div>
            <div>
                <input type='text' v-model='form.short_name' placeholder='请输入公司简介'>
            </div>
            <div>
                <input type='text' v-model='form.leader' placeholder='负责人'>
            </div>
        </div>
        <div class='next-step'>
            <div>
                <!--<router-link to="/register/Putforward_information" tag='button' class='next'>下一步</router-link>-->
                <el-button type='primary' class='next' :disabled='nextVisible' @click='NextStep'>下一步</el-button>
            </div>
            <div class='Return'>
                <p>已有账号，<router-link to="/" replace>马上登录></router-link></p>
            </div>
        </div>
    </div>
</template>
<script>
    import { regTwo,deleteInfo } from '@/server/serverData'
    export default{
        name:'RepairInformation',
        data(){
            return{
               form:{
                   company:'',
                   short_name:'',
                   leader:'',
                   sid:this.$route.query.sid
               }
            }
        },
        computed:{
            nextVisible(){
                let state=true,company=this.form.company,short_name=this.form.short_name,leader=this.form.leader;
                if(company && short_name && leader){
                    state=false
                }
                return state
            }
        },
        methods:{
            /** 清楚无效数据 **/
//            async clearInfo(){
//                 try {
//                     let res = await deleteInfo()
//                 }catch (err){
//                     console.log(err)
//                 }
//             },
            /** 下一步操作 **/
            async NextStep(){
                let res= await regTwo(this.form)
                if(res.data.code==1){
                    var that=this;
                    console.log(res.data.data)
                    this.$message({message:res.data.msg,type:'success',duration:'1000',onClose(){
                        that.$router.push({path:'/register/Putforward_information',query:{sid:that.form.sid,shop_type:that.$route.query.shop_type}})
                    }})
                }else {
                    this.$message.error(res.data.msg)
                }
            }
        },
//    activated(){
//        this.clearInfo()
//    }
    }
</script>
<style scoped lang='scss' rel="stylesheet/scss">
    .Repair_information{
        padding: 40px 46px;
    }
    .step{
        position: relative;
        width: 100%;
        height: 40px;
        background-image: url("../../public/login/step2.png");
        background-repeat: no-repeat;
        background-size: 100% 100%;
        line-height: 40px;
        margin-bottom: 40px;
        ul:after{
            display: block;
            content: '';
            clear: both;
        }
        ul{
            .col-919{
                color: #91969B;
            }
            li{
                width: calc(100%/3);
                float: left;
                list-style: none;
                text-align: center;
                color: white;
                font-size: 12px;
                a{
                    color: white;
                }
            }
        }
    }
    .form{
        margin-bottom: 128px;
        div{
            border-bottom: 1px solid #E5E5E5;
            margin-bottom: 10px;
            input{
                border: none;
                padding: 15px 0;
                outline: none;
            }
            input::-webkit-input-placeholder{
                color:#B9C3CD;
            }
            .Verification{
                background: none;
                float: right;
                border: 1px solid #E5E5E5;
                height: 36px;
                line-height: 36px;
                border-radius:5px;
                width: 120px;
                text-align: center;
            }
        }
    }
    .next{
        width: 100%;
    }
    .Return{
        text-align: center;
        margin-top: 10px;
        a{
            color: #3498E9;
        }
    }
</style>